﻿namespace BlamanticUI.Components;

/// <summary>
/// Represents a space between two paragraphs.
/// </summary>
/// <seealso cref="BlamanticUI.Abstractions.BlamanticComponentBase" />
public class Space : BlazorComponentBase
{
    /// <summary>
    /// Gets or sets a value indicating whether the space is horizontal.
    /// </summary>
    [Parameter] public bool Horizontal { get; set; }

    /// <summary>
    /// Gets or sets the increasing space between two sections.
    /// </summary>
    [Parameter] public bool Section { get; set; }

    /// <summary>
    /// Gets or sets a value indicating whether to clear the float.
    /// </summary>
    [Parameter] public bool Clearing { get; set; }

    /// <summary>
    /// Renders the component to the supplied <see cref="T:Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder" />.
    /// </summary>
    /// <param name="builder">A <see cref="T:Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder" /> that will receive the render output.</param>
    protected override void BuildRenderTree(RenderTreeBuilder builder)
    {
        builder.CreateComponent<Divider>(0, attributes: new { Hidden = true, Horizontal, Section, Clearing });
    }
}
